package sis.ra.yahoor.result;

import java.util.ArrayList;
import java.util.HashMap;

import sis.ra.partofspeech.wordindex;
import sis.ra.utility.Utils;

public class parseContent {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String filepath="C:\\Documents and Settings\\I820753\\Desktop\\dataset\\result1003.txt";
		String content=Utils.readFile(filepath);
		String [] lines=content.split("\n");
		String filename="";
		for (int i=0;i<lines.length;i++)
		{
//			System.out.println(lines[i]);
			String line=lines[i];
			if (line.contains(".txt"))
			{
				System.out.println(line);
				Utils.writeToFile("C:\\Documents and Settings\\I820753\\Desktop\\dataset\\result1003.pos", line,true,true);
				filename=line;
			}else
			{
				ArrayList<String> resultlist=parseYahooResults.getResultList(parseYahooResults.pos(line, "text"));
				String result="";
				for (int n=0;n<resultlist.size();n++)
				{
					result=result+resultlist.get(n);
				}
				System.out.println(result);
				Utils.writeToFile("C:\\Documents and Settings\\I820753\\Desktop\\dataset\\result1003.pos", result,true,true);
			}
		}
	}

}
